/*
 * @Description: 交易类型-退款
 * @Author: yingying.fan
 * @Date: 2019-03-18 13:38:28
 * @Last Modified by: yingying.fan
 * @Last Modified time: 2019-03-18 14:26:48
 */
<script>
import BaseConsumeItem from './BaseConsumeItem'
import {
  REFUND_BUS,
  REFUND_OFFLINE,
  REFUND_STAFF_MEAL,
  REFUND_ONLINE,
  REFUND_TRANSFER
} from '../../../consumedetail/constants/TradeDetailType.js'
export default {
  name: 'ConsumeRefundItem',
  extends: BaseConsumeItem,
  watch: {
    tradeDetailType(newValue, oldValue) {
      switch (newValue) {
        case REFUND_BUS:
          this.iconUrl = require('../../assets/refund.png')
          this.tradeText = '乘坐公交退款'
          break
        case REFUND_TRANSFER:
          this.iconUrl = require('../../assets/refund_transfer.png')
          this.tradeText = '换乘优惠' + (this.data.ROUTE_NAME ? ('-' + this.data.ROUTE_NAME) : '')
          break
        case REFUND_OFFLINE:
          this.iconUrl = require('../../assets/refund.png')
          this.tradeText = '线下消费退款'
          break
        case REFUND_STAFF_MEAL:
          this.iconUrl = require('../../assets/refund.png')
          this.tradeText = '公司订餐退款'
          break
        case REFUND_ONLINE:
          this.iconUrl = require('../../assets/refund.png')
          this.tradeText = '员工卡退款'
          break
      }
    }
  },
  methods: {
    // 交易失败
    parseWhenTradeFailure() {

    },
    // 交易退款
    parseWhenTradeRefund() {

    },
    // 交易成功
    // parseWhenTradeSuccess() {
    //   this.payFeeDesc = '+' + this.payPrice
    // },
    // 交易中
    parseWhenTrading() {
      this.stateDesc = '退款中'
    }
  }
}
</script>
